﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Users.aspx.cs" Inherits="MadeInPortugalWebApplication.Users" %>
<%@ Register TagName="UserPassword" TagPrefix="MadeInPortugal" Src="~/WebControl/UserPass.ascx" %>
<%--<%@ Register TagName="Navigation" TagPrefix="MadeInPortugal" Src="~/WebControl/Navigation.ascx" %>--%>
<%@ Register TagName="ProductListWC" TagPrefix="MadeInPortugal" Src="~/WebControl/ProductListWC.ascx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderHeadTitle" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="UserContentPlaceHolder" runat="server">
    <MadeInPortugal:UserPassword ID="UserPassword" runat="server" />
</asp:Content>
<%--<asp:Content ID="Content4" ContentPlaceHolderID="NavidationPlaceholder" runat="server">
    <madeinportugal:Navigation ID="Navigation" runat="server" />
</asp:Content>--%>



<asp:Content ID="Content7" ContentPlaceHolderID="ContentPlaceHolderNavigation" runat="server">
    <nav>
		<ul >				
			<li><a href="AdminProductList.aspx"><span>Diretório</span></a></li>						
			<li class="active"><a href="users.aspx"><span>Utilizadores</span></a></li>
			<li ><a href="blacklist.aspx"><span>Blacklist</span></a></li>
            <li><a href="Properties.aspx"><span>Propriedades</span></a></li>
		</ul>			
	</nav>
</asp:Content>

<asp:Content ID="Content8" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel runat="server" ID="directoryUpdatePanel" UpdateMode="Conditional">
        <ContentTemplate>
        <section id="page">
        <div class="user list">
            <h2 class="pageTitle">
                Utilizadores</h2>
            <ul class="actions">
                <li><a href="user.aspx" class="add"><span><b></b>Adicionar utilizador</span></a></li>
            </ul>
            <div class="feedback">
                <div runat="server" id="feedbackPanel">
                </div>
            </div>
            <div class="advancedUserOptions closed">
                <h4>
                    <b></b>Pesquisa</h4>
                <div class="form filter">
                    <p class="half">
                        <label>
                            Nome
                        </label>
                        <input style="text-align:left" size="20" maxlength="50" />
                    </p>
                    <p class="half" style="text-align:left">
                        <label>
                            Número
                        </label>
                        <input style="width:170px" size="20" maxlength="50" />
                    </p>
                    <p class="buttons">
                        <a href="#" class="button" ><span>Pesquisar</span></a>  
                        <a href="#" class="button cancel" ><span>Limpar</span></a> 
                    </p>
                </div>
            </div>
            <asp:GridView ID="userGridView" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
                OnRowCommand="GridView_RowCommand" CssClass="matrix">
                <Columns>
                    <asp:TemplateField HeaderText="Número" SortExpression="Id">
                        <ItemTemplate>
                            <asp:Label ID="lbNumber" runat="server" Text='<%# Eval("Id")%>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Nome">
                        <ItemTemplate>
                            <asp:Label ID="lbName" runat="server" Text='<%# GetUserName(Eval("Id"))%>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Número de Items" SortExpression="MaxItems">
                        <ItemTemplate>
                            <asp:TextBox ID="tbxMaxItems" runat="server" Text='<%# Eval("Name") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Nova Janela" SortExpression="OpenNewWindow">
                        <ItemTemplate>
                            <asp:TextBox ID="cbOpenNewWindow" runat="server" Text='<%# GetUserName(Eval("Id"))%>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:ButtonField ButtonType="Link" CommandName="Save" Text="Guardar" />
                </Columns>
            </asp:GridView>
            <asp:HiddenField runat="server" ID="hfPageNumber" Value="1" />
            <ul id="pagination">
                <asp:Repeater runat="server" ID="paginationList" OnItemCommand="RepeaterChangePage_Command">
                    <HeaderTemplate>
                        <li>Página</li>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <li class='<%# DataBinder.Eval(Container.DataItem, "Class") %>'>
                            <asp:LinkButton runat="server" ID="paginationItem" Text='<%# DataBinder.Eval(Container.DataItem, "PageNumber") %>'
                                CommandName="goPage" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "PageNumber") %>' />
                        </li>
                    </ItemTemplate>
                </asp:Repeater>
            </ul>
            </div>
            </section>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>